<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1,1,2,3,5,8,13,21.....
                   5
    // function fn1(num) {
    //     return 1;
    // }
    //  function fn2(num) {
    //      return 1;
    //  }
      
    //   function fn3(num) {
    //      return fn2(num-1)+fn1(num-2)
    //   }

    //   function fn4(num) {
    //      return fn3(num-1)+fn2(num-2);
    //   }

    //   function fn5(num) {
    //     return fn4(num-1) + fn3(num-2); 
    //   }
    //   console.log(fn5(5));

    function fn5(num) {
        if(num==2 || num==1){
            // 递归的出口:递归循环停止；
            return 1;
        }
        return fn5(num-1) + fn5(num-2);
    }
    console.log(fn5(8));
    </script>
</body>
</html>